package zy;

import java.util.ArrayList;
import java.util.List;

/*
 *@Student 张策
 */
public class Cust {
    String name;
    String VIP="普通用户";
    double money=0;


    public Cust(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVIP() {
        return VIP;
    }

    public void setVIP(String VIP) {
        this.VIP = VIP;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Cust{" +
                "name='" + name + '\'' +
                ", VIP=" + VIP +
                ", money=" + money +
                '}';
    }
    //充值记录
    public List<String> rechargeRecords=new ArrayList<>();


    public List<Order> consumptionRecords =new ArrayList<>();
    public void printPersonalInformation(Warehouse warehouse){
        System.out.println("个人信息");
        System.out.println("姓名:"+getName()+"余额:"+getMoney()+getVIP());
        System.out.println("充值记录:");
        for (int i = 0; i < rechargeRecords.size(); i++) {
            System.out.println(rechargeRecords.get(i));
        }
        System.out.println("消费记录:");
        if (getVIP().equals("VIP用户")){
            System.out.println("充值会员200元");
        }
        for (int i = 0; i < consumptionRecords.size(); i++) {
            if(warehouse.orders.contains(consumptionRecords.get(i))){
                System.out.println(consumptionRecords.get(i).toString2()+"未处理");
            }else{
                System.out.println(consumptionRecords.get(i).toString2()+"已处理");
            }
        }
    }
}
